package com.ss.ttm.player;

import android.content.Context;
import android.view.Surface;

import inline.ScreenshotListener;

public class p extends f {
    volatile long a;
    private n b;
    private TTPlayerClient mTTPlayerClient;

    public p(n arg3) {
        this.a = 0;
        this.b = arg3;
        this.a = System.currentTimeMillis();
        this.a = arg3.f(this.a);
    }

    public static p a(TTPlayerClient ttPlayerClient, Context context) {
        p v0 = o.a(context);
        if (v0 == null) {
            v0 = null;
        } else {
            v0.mTTPlayerClient = ttPlayerClient;
        }

        return v0;
    }

    public final void a(int arg2, int arg3, int arg4, String arg5) {
        this.mTTPlayerClient.onPlayerNotify(arg2, arg3, arg4, arg5);
    }

    public final int getIntOption(int arg5, int arg6) {
        return this.b.a(this.a, arg5, arg6);
    }

    public final int setLongOption(int arg7, long arg8) {
        return this.b.a(this.a, arg7, arg8);
    }

    public final int setStringOption(int arg5, String arg6) {
        return this.b.a(this.a, arg5, arg6);
    }

    public final void prevClose() {
        n v0 = this.b;
        long v2 = this.a;
        if (v0.a != null) {
            try {
                v0.a.preClose(v2);
            } catch (Throwable v0_1) {
                v0_1.printStackTrace();
            }
        }
    }

    public final void setVolume(float arg5, float arg6) {
        this.b.a(this.a, arg5, arg6);
    }

    public final void setLooping(int arg5) {
        this.b.b(this.a, arg5);
    }

    public final void mouseEvent(int arg8, int arg9, int arg10) {
        this.b.a(this.a, arg8, arg9, arg10);
    }

    public final void a(int arg2, int arg3, String arg4) {
        this.mTTPlayerClient.onPlayLogInfo(arg2, arg3, arg4);
    }

    public final void setNotifyerState(long arg6) {
        this.b.a(this.a, arg6);
    }

    protected final void setOnScreenshotListener(ScreenshotListener arg1) {
    }

    public final void setVideoSurface(Surface arg5) {
        this.b.a(this.a, arg5);
    }

    public final void setDataSource(String arg5) {
        this.b.a(this.a, arg5);
    }

    public final void setCacheFile(String arg5, int arg6) {
        this.b.a(this.a, arg5, arg6);
    }

    public final void b(String arg2) {
        this.mTTPlayerClient.onCrashedInfo(arg2);
    }

    public final int setIntOption(int arg5, int arg6) {
        return this.b.b(this.a, arg5, arg6);
    }

    public final long getLongOption(int arg7, long arg8) {
        return this.b.b(this.a, arg7, arg8);
    }

    public final void close() {
        try {
            n v1 = this.b;
            long v2 = this.a;
            Throwable v0_1 = null;
            if (v1.a == null) {
                String v4 = "close";
                String v0_2 = v0_1 == null ? "player is null" : v0_1.getMessage();
                throw new Exception(n.a(v2, v4, v0_2));
            }

            try {
                v1.a.close(v2);
            } catch (Throwable throwable) {
                throwable.printStackTrace();
                v0_1 = throwable;
                String v4 = "close";
                String v0_2 = v0_1 == null ? "player is null" : v0_1.getMessage();
                throw new Exception(n.a(v2, v4, v0_2));
            }
        } catch (Exception v0) {
            m.a(7, true);
        }
    }

    public final void rotateCamera(float arg5, float arg6) {
        this.b.b(this.a, arg5, arg6);
    }

    public final void seekTo(int arg5) {
        this.b.c(this.a, arg5);
    }

    public final String getStringOption(int arg5) {
        return this.b.a(this.a, arg5);
    }

    public final void release() {
        long v2 = this.a;
        this.a = 0;
        try {
            n v1 = this.b;
            Throwable v0_1 = null;
            if (v1.a == null) {
                String v4 = "release";
                String v0_2 = v0_1 == null ? "player is null" : v0_1.getMessage();
                throw new Exception(n.a(v2, v4, v0_2));
            }

            try {
                v1.a.release(v2);
            } catch (Throwable throwable) {
                throwable.printStackTrace();
                v0_1 = throwable;
                String v4 = "release";
                String v0_2 = v0_1 == null ? "player is null" : v0_1.getMessage();
                throw new Exception(n.a(v2, v4, v0_2));
            }
        } catch (Exception v0) {
            m.a(7, true);
        }

        o.a(v2);
    }

    public final void start() {
        this.b.a(this.a);
    }

    public final void pause() {
        this.b.b(this.a);
    }

    public final void reset() {
        this.b.d(this.a);
    }

    public final void stop() {
        this.b.c(this.a);
    }

    public final void prepare() {
        this.b.e(this.a);
    }

    public final Context i() {
        return o.a();
    }

    public final int j() {
        return 2;
    }

    protected final boolean k() {
        return this.a != 0;
    }

    protected final int l() {
        return this.b.a(this.a, 35, -1);
    }

    public final void takeScreenshot() {
    }

    protected final void n() {
        this.a = 0;
    }
}

